home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmTranspic
- BackColor = &H00C0C0C0&
- Caption = "The Transparent Picture Program"
- ClientHeight = 5430
- ClientLeft = 1245
- ClientTop = 1650
- ClientWidth = 6015
- Height = 6120
- Icon = "TRANSPIC.frx":0000
- Left = 1185
- LinkTopic = "Form1"
- ScaleHeight = 5430
- ScaleWidth = 6015
- Top = 1020
- Width = 6135
- Begin VB.CommandButton cmdChangeBackground
- Caption = "&Change Background Color"
- Height = 855
- Left = 1680
- TabIndex = 3
- Top = 4440
- Width = 2415
- End
- Begin TegoswLibCtl.Tegosw swExit
- Height = 630
- Left = 0
- TabIndex = 2
- Top = 0
- Width = 525
- _version = 65536
- _extentx = 926
- _extenty = 1111
- _stockprops = 64
- value = -1 'True
- End
- Begin TegopicLibCtl.TegoPic picButton
- Height = 1470
- Left = 4440
- TabIndex = 1
- Top = 3840
- Width = 1470
- _version = 65536
- _extentx = 2593
- _extenty = 2593
- _stockprops = 65
- backcolor = -2147483633
- imagepicture = "TRANSPIC.frx":030A
- maskpicture = "TRANSPIC.frx":1784
- autosize = -1 'True
- End
- Begin TegopicLibCtl.TegoPic picBug
- Height = 1575
- Left = 2040
- TabIndex = 0
- Top = 1560
- Width = 2175
- _version = 65536
- _extentx = 3836
- _extenty = 2778
- _stockprops = 65
- imagepicture = "TRANSPIC.frx":2BFE
- maskpicture = "TRANSPIC.frx":A5F8
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "Help"
- Begin VB.Menu mnuAbout
- Caption = "&About..."
- End
- End
- Attribute VB_Name = "frmTranspic"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- ' All variables must be declared.
- Option Explicit
- Private Sub cmdChangeBackground_Click()
- Static Background
- ' Increment the Background static variable
- Background = Background + 1
- ' If Background is greater than 15, reset it to 0.
- If Background > 15 Then Background = 0
- ' Change the color of the form according to the
- ' current value of Background.
- Me.BackColor = QBColor(Background)
- ' Change the background color of the picButton
- ' and picBug transparent picture controls to the
- ' new color of the form.
- picButton.BackColor = Me.BackColor
- picBug.BackColor = Me.BackColor
- End Sub
- Private Sub Form_Click()
- MsgBox "You clicked the form."
- End Sub
- Private Sub mnuAbout_Click()
- Dim Title
- Dim Msg
- Dim CR
- CR = Chr(13) + Chr(10)
- ' The title of the About message box.
- Title = "About the Transparent Picture Program"
- ' Prepare the message of the About message box.
- Msg = "This program was written with Visual "
- Msg = Msg + "Basic for Windows, using the "
- Msg = Msg + "TegoSoft Transparent Picture OCX control. "
- Msg = Msg + CR + CR
- Msg = Msg + "The TegoSoft Transparent Picture OCX control "
- Msg = Msg + "is part of the TegoSoft OCX Control "
- Msg = Msg + "Kit - a collection of various OCX controls. "
- Msg = Msg + CR + CR
- Msg = Msg + "For more information about the "
- Msg = Msg + "TegoSoft OCX Control Kit, contact TegoSoft "
- Msg = Msg + "at:"
- Msg = Msg + CR + CR
- Msg = Msg + "TegoSoft Inc." + CR
- Msg = Msg + "P.O. Box 389" + CR
- Msg = Msg + "Bellmore, NY 11710"
- Msg = Msg + CR + CR
- Msg = Msg + "Phone: (516)783-4824"
- ' Display the About message box.
- MsgBox Msg, vbInformation, Title
- End Sub
- Private Sub mnuExit_Click()
- ' Terminate the program.
- Unload Me
- End Sub
- Private Sub picBug_ClickImage(ByVal Transparent As Boolean)
- ' If Transparent is equal to False, it means that
- ' the user clicked a non-transparent section of the
- ' picture. If however, Transparent is equal to True,
- ' it means that the user clicked a transparent
- ' section of the picture (i.e. the user clicked the form).
- ' If the user clicked a transparent section of the
- ' picture, execute the Form_Click procedure. Otherwise,
- ' display a message box.
- If Transparent = True Then
- Form_Click
- MsgBox "You clicked the bug."
- End If
- End Sub
- Private Sub picButton_ClickImage(ByVal Transparent As Boolean)
- ' If Transparent is equal to False, it means that
- ' the user clicked a non-transparent section of the
- ' picture. If however, Transparent is equal to True,
- ' it means that the user clicked a transparent
- ' section of the picture (i.e. the user clicked the form).
- ' If the user clicked a transparent section of the
- ' picture, execute the Form_Click procedure. Otherwise,
- ' display a message box.
- If Transparent = True Then
- Form_Click
- MsgBox "You clicked the diagonal pushbutton."
- End If
- End Sub
- Private Sub picButton_MouseDownOnImage(ByVal Transparent As Boolean, ByVal x As Integer, ByVal y As Integer, ByVal Button As Integer)
- ' If Transparent is equal to False, it means that
- ' the user pressed the mouse button down over
- ' a non-transparent section of the picture.
- ' If however, Transparent is equal to True,
- ' it means that the user pressed the mouse button
- ' down over a transparent section of the picture
- Dim Path
- ' Get the name of the directory where the
- ' program resides.
- Path = App.Path
- If Right(Path, 1) <> "\" Then
- Path = Path + "\"
- End If
- ' If the user pressed the mouse button down over
- ' a non-transparent region of the diagonal pushbutton
- ' picture, display a picture that shows the diagonal
- ' pushbutton in its Down position.
- If Transparent = False And Button = 1 Then
- picButton.SetImageAndMask LoadPicture(Path + "button2.bmp"), LoadPicture(Path + "mbutton2.bmp")
- End If
- End Sub
- Private Sub picButton_MouseUpOnImage(ByVal Transparent As Boolean, ByVal x As Integer, ByVal y As Integer, ByVal Button As Integer)
- Dim Path
- ' Get the name of the directory where the
- ' program resides.
- Path = App.Path
- If Right(Path, 1) <> "\" Then
- Path = Path + "\"
- End If
- ' Display a picture that shows the diagonal pushbutton
- ' in its Up position.
- picButton.SetImageAndMask LoadPicture(Path + "button1.bmp"), LoadPicture(Path + "mbutton1.bmp")
- End Sub
- Private Sub swExit_Click()
- Dim Title
- Dim Question
- Dim Response
- ' If the user turned the swExit switch OFF,
- ' confirm that the user wants to exit the
- ' program, and if so, exit the program.
- If swExit.Value = False Then
- Title = "Exit Program"
- Question = "Are you sure you want to exit?"
- Response = MsgBox(Question, vbYesNo + vbQuestion, Title)
- If Response = vbYes Then
- Unload Me
- Else
- swExit.Value = True
- End If
- End If
- End Sub
-